﻿@{
    Layout = "_Layout";
}
@model Nxg.Blog.Core.ViewProjections.Admin.CategoryManageViewModel
<div class="main">
    <div class="post-wrap archive">
        <table class="table" style="width: 100%;">
            <thead>
                <tr>
                    <th style="width: 35%;text-align:left;">Name</th>
                    <th style="width: 35%;text-align:left">DispalyName</th>
                    <th style="width: 30%;text-align:left" class="text-center" style="width:46px;">Operation</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var category in Model.Categories)
                {
                    <tr>
                        <td>
                            <a href="">@category.Name</a>
                        </td>
                        <td>
                            @category.DisplayName
                        </td>
                        <td>
                            <a href="~/admin/category/edit/@category.Id" class="btn btn-default btn-xs">编辑</a>
                            <a href="~/admin/category/delete/@category.Id" class="btn btn-danger btn-xs">删除</a>
                        </td>
                    </tr>
                }
            </tbody>
        </table>

        <div style="text-align:center;">
            @if(Model.HasPrevPage){
                <a href="/post/@(Model.Page-1)">pre</a>
            }

            @if(Model.HasNextPage && Model.HasPrevPage){
                <span>.</span>
            }
            
            @if(Model.HasNextPage){
                <a href="/post/@(Model.Page+1)">next</a>
            }
        </div>
    </div>
</div>